Skip to content

docs(lint): put translation-section-name-missing's warning on its own reading - #18970

Merged
os-bill merged 2 commits into
mainfrom
claude/issue-18768-sibling-severity-cross-reference
Sep 18, 2026
Merged

os-bill merged 2 commits into
mainfrom
claude/issue-18768-sibling-severity-cross-reference

Conversation

@os-bill

@os-bill os-bill commented Sep 18, 2026

Copy link
Copy Markdown
Collaborator

Fixes #18768

Clause-②: no

packages/lint/src/validate-translatable-sections.ts justified its own warning
severity by citing its sibling rule's reading. The sibling abandoned that reading at
#16310, which promoted translation-target-unknown from warning to error. The
conclusion is still right; the argument was not. This rewrites the Severity note so it
stands on its own reading, and fixes the one other place that narrates the superseded
note in the present tense.

Comments and docblock prose only — no severity, no schema, no assertion moves.

Subject leg — the Severity note, sentence by sentence

Before (validate-translatable-sections.ts:42-47), four sentences:

  1. Same reading as its sibling rule (ADR-0072 D1): nothing crashes and nothing is dead — one heading renders in the source locale.
  2. That is weaker than the dead references validate-object-references reports as errors, and the severity should say so.
  3. Requiring name outright is a SCHEMA change (FormSection.name is optional today), …
  4. … which is a breaking authoring change needing a maintainer decision and a migration — deliberately not taken here.

Sentence 1 is the whole defect: it is an appeal to a neighbour's position, and the
neighbour moved. Sentences 2 to 4 were always this rule's own and are kept.

After, the mapping:

  • Sentence 1 is replaced by two paragraphs. The first names the staleness instead of
    inheriting it — the sibling stopped holding this reading at #16310, and the verdict
    here survives that; the borrowed argument for it did not. The second states the
    reading that actually holds here: A nameless section MISDESCRIBES NOTHING — the
    section is real and renders, the whole cost is one heading staying in the source
    locale, and it leaves behind no artefact for the next author to trust: there is no key, so there is nothing to grep. The contrast with the orphan key the sibling gates
    on (a confident-looking hit, in every locale, for a surface that was DELETED) is the
    asymmetry that earns that one error and this one warning.
  • Sentences 2, 3 and 4 are carried over unchanged in substance (sentence 2 re-worded
    only to read as an addition: It is weaker … too).

The reasoning is not invented here. packages/lint/src/reference-integrity-suite.ts:406
already carries it — warning-only on its own reading — NOT on its sibling's any more.
That file is read as evidence and is not touched by this PR; the rule's own header is
now consistent with it.

Second carrier — narration only

packages/lint/src/validate-translation-references.test.ts:24-28 described the
superseded note in the present tense (the rule's own Severity note argued an orphan key is inert), inviting a reader to go find an argument that the same change deleted. The
narration is now past-tense and self-limiting (the rule's Severity note AS IT THEN STOOD argued that an orphan key was inert), with a pointer that the note itself was rewritten.

No assertion moved. All ten severity: 'error' sites in that file are byte-identical;
only their line numbers shift by +2 because the docblock grew two lines. A diff restricted
to non-comment lines in that file is empty:

git diff -U0 BASE -- packages/lint/src/validate-translation-references.test.ts \
  | grep -E '^[+-]' | grep -v '^[+-][+-]' | grep -vE '^[+-] \*'
(no output)

Firing control — the probe cannot be fooled by a line wrap

Both anchors this round turns on are wrapped across comment lines, and so is the card's
designated positive control (skills/objectstack-i18n/SKILL.md:196-197). A line-scoped
git grep -F reads 0 on two of the three needles below — on the unedited tree, where
all three are present. The census therefore strips comment leaders, collapses all
whitespace including newlines to one space, and only then matches.

needle line-scoped grep, unedited tree fold-proof, before fold-proof, after
Same reading as its sibling rule (ADR-0072 D1) 1 1 0
warning-only on its own reading — NOT on its sibling's any more 0 (wrapped) 1 1
`translation-target-unknown` is an **error** and fails the run 0 (wrapped) 1 1

Population: 8885 tracked text files (10 binary/non-file skipped). The two 1s are read in
the same run as the 0, so the 0 is a reading and not a dead index.

DARK

packages/lint before and after, both through the shared verify lock:

Test Files  104 passed (104)
     Tests  3910 passed (3910)

identical on both sides, plus pnpm --filter @objectstack/lint typecheck green after.
Repo-wide eslint . --no-inline-config at this branch's head: 6855 files, 0 errors,
0 warnings
, exit 0.

Changeset — skip-changeset, measured rather than assumed

@objectstack/lint publishes files: ["dist","README.md","CHANGELOG.md"]. Built at BASE
and at BASE-plus-this-diff in two separate worktrees and compared file by file:

  • byte-identical: index.js, index.cjs, runtime.js, runtime.cjs, index.d.ts,
    index.d.cts, runtime.d.ts, runtime.d.cts — every executable and every type output.
  • moved: the four .map files, in exactly one field. version, sources and names
    are identical; sourcesContent is absent on both sides (this repo gates that with
    check:sourcemap-no-sources-content), so no source text — and therefore no comment
    prose — ships at all. What moved is mappings, the original-position index, because
    code moved 15 lines down a source file.
  • grep control over every files[] path: the changed prose scores 0 hits, while the
    positive control translation-section-name-missing scores hits in 6 dist files.

So nothing an upgrading consumer can read, grep, type-check or execute differs. The
.map shift is the unavoidable arithmetic of editing any comment above code in a built
package, not a published change. Flagged here rather than assumed, because a
byte-comparison of the tarball does technically move.

Gates

node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack, derived
on this tree, run one by one with each exit code landed to disk before anything read it,
then reconciled with --ran:

Run reconciliation — 51 derived, 49 run, 2 NOT-MEASURED, 0 UNRUN.

The two NOT-MEASURED are check:dual-build-cjs-loads and check:type-check-debt. Both
exited 3 — their own PREREQUISITE NOT MET code, which each gate's output states is
neither a pass nor a failure. Both need the whole workspace built (83 packages and 27
dependency closures respectively); CI builds before running them.
check:lean-entry-closure was in the same state, its one prerequisite package was built,
and it then passed.

Acceptance notes


Generated by Claude Code

…wn reading

`validate-translatable-sections`'s Severity note justified its `warning` by
citing its sibling rule's reading — a position the sibling abandoned when
`translation-target-unknown` was promoted to `error`. The conclusion is
unchanged and correct; only the borrowed argument was stale, so the note now
spells out the reading that actually holds here: a nameless section
misdescribes nothing, whereas an orphan locale key is a confident-looking grep
hit for a surface that was deleted.

`validate-translation-references.test.ts`'s docblock narrated the superseded
note in the present tense; its tense and claim are corrected. No assertion, no
severity, no schema moves — comments only.

Claude-Session: https://claude.ai/code/session_01JbZnqu8bt6YqfJsr9vaFb3
Co-authored-by: Claude <noreply@anthropic.com>
@os-bill os-bill added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Sep 18, 2026 — with Claude
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

⚠️ 1 changed file(s) yielded no anchor (packages/lint/src/validate-translatable-sections.ts), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files. Nothing else in this diff resolved to a documentable surface (no symbol, route or SDK anchor derived from 1 changed package(s)).

What this run could not see
  • 1 changed file(s) yielded no anchor (packages/lint/src/validate-translatable-sections.ts) — pages documenting those are invisible to this run
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.

Coarse fallback — 4 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 89c6ec52b56a24d94c5bdea57fb8a7a8db4273da → packageMentionDocs.

@github-actions github-actions Bot added the tests label Sep 18, 2026

os-bill commented Sep 18, 2026

Copy link
Copy Markdown
Collaborator Author

裁断:A —— skip-changeset 保持。并认下:那条「停手线」是我写得太字面

派发席(domain:spec seat 2,座位贴 #18549)。⏱️ 2026-09-18T08:45Z 取数。

我的错

我在派发令里写「若你量出 tarball 会动,那是停手线」。dev 量到它确实动(四个 .map 的 mappings 字段),于是照规矩不自作主张、交回来问。

⭐ 它做对了,而那条栅栏按字面是错的:改动任何一个位于代码上方的注释,都会移动 built 产物的 mappings 偏移 —— 那是算术,不是内容。⇒ 照字面执行,skip-changeset 对任何发布 dist 的包里的任何纯注释改动都不可达,而仓规恰恰把注释列在「不发布」的快车道上。

⇒ 我本该写的是「若消费者能读到的内容会动」,而不是「若字节会动」。

为什么 A 成立 —— 我读了机制,⛔ 不是采样一次构建

packages/lint/tsup.config.ts 把 esbuildOptions: dropSourcesContent 接在构建上,而那个函数(scripts/tsup-drop-sources-content.mjs)的全部函数体是:

export function dropSourcesContent(options) {
  options.sourcesContent = false;
}

它的模块头自述:「sourcemap: true 是 tsup 自己的选项、保持不动 —— mappings(栈帧位置)不受影响。sourcesContent …… esbuild 自己的默认是 true —— 没有人决定把每个包的完整原始源码(注释在内)发布到 npm,那是从一个没人看过的默认里掉出来的。」并点名 check:sourcemap-no-sources-content 是钉住它的那道门禁。

实测对照,读一份已发布的 map:

packages/spec/dist/shared/index.js.map
  keys: version, sources, names, mappings, file
  sourcesContent present? false          ← 键根本不存在
  sources 38 条 | mappings 278501 字符

⇒ ⭐ 注释文本在构造上就不可能进 tarball。 动的只有 mappings 偏移。dev 另外量到:index.js / index.cjs / runtime.js / runtime.cjs 与四个 .d.ts/.d.cts 逐字节相同,改动的散文在全部 files[] 路径上评分 0(阳性对照 translation-section-name-missing 命中 6 个 dist 文件)。

⇒ A。⛔ 不加 changeset

B 会让 @objectstack/lint 的 CHANGELOG 发一句描述「调试元数据偏移」的话给消费者 —— 那句话对读它的人没有任何意义。

⭐ 这是本班第四次我写下过于字面的约束,其中三次载体是只读栅栏或停手线。dev 每一次都是量完交回,⛔ 没有一次绕过去。


Generated by Claude Code

@os-bill
os-bill marked this pull request as ready for review September 18, 2026 08:45
@os-bill
os-bill added this pull request to the merge queue Sep 18, 2026
Merged via the queue into main with commit 2265bb0 Sep 18, 2026
40 checks passed
@os-bill
os-bill deleted the claude/issue-18768-sibling-severity-cross-reference branch September 18, 2026 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/s skip-changeset PR has no user-facing published change; bypasses the changeset gate tests

Projects

None yet

2 participants